<template>
    <div>
        <h2>欢迎 {{loginName}} 访问蜗年书城后台管理系统</h2>

        <el-button type="info" @click="testPermission">权限测试</el-button>
    </div>
</template>

<script>
    export default {
        name: "WelcomeView",
        data(){
            return {
                loginName: "默认的名字"
            }
        },
       methods: {
           showLoginName(){
                this.loginName = sessionStorage.getItem("loginName");
           },
           testPermission(){
               let url = "/api/order/addOrder"

               this.$axios.get(url).then(response => {
                    console.log(response.data);
               })
           }

       },
        created() {
            this.showLoginName();
        }


    }
</script>

<style scoped>

</style>
